package com.hengxinguotong.hxgtwygsp.ui.propertyService.fee;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hengxinguotong.hxgtwygsp.R;
import com.hengxinguotong.hxgtwygsp.model.AnnualFeesBean;

import java.util.List;

/**
 * Created by CS-Yong
 * 2019/8/11  21:45
 */
public class AnnualFeesAdapter extends BaseQuickAdapter<AnnualFeesBean, BaseViewHolder> {
    private int drawableId;
    public AnnualFeesAdapter(int layoutResId, @Nullable List<AnnualFeesBean> data,int id) {
        super(layoutResId, data);
        this.drawableId = id;
    }

    @Override
    protected void convert(BaseViewHolder helper, AnnualFeesBean item) {
        int position = helper.getAdapterPosition();
        helper.setImageResource(R.id.fees_icon,drawableId);
        ImageView mIcon = helper.getView(R.id.fees_icon);
        mIcon.setImageLevel(position);
        helper.setText(R.id.fees_name,item.getName());
        helper.setText(R.id.fees_money,item.getMoney());
        helper.setText(R.id.fees_rate,item.getRate());
        if (position%2 == 0) {
            helper.setBackgroundRes(R.id.ll_item, R.color.c33FFFFFF);
        }
    }
}
